/*
 * CS575 Software Design
 * Group 6
 * Group Members: Anthony Davidson, Kendra Scheesley, Lyndsey Whitman, Stephen Zakrewsky
 * Date: May 28, 2012
 * Main Author(s): Anthony Davidson
 */
package edu.drexel.cs575.a3.location;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import edu.drexel.cs575.a3.tax.TaxRate;

/**
 * Represents a location located on....earth.
 * 
 * @author anthony
 *
 */
public class EarthLocation implements Location {
	private List<TaxRate> taxRates;
	private LocaleEnum localeEnum;
	
	@Override
	public List<TaxRate> getTaxRates() {
		return Collections.unmodifiableList(this.taxRates);
	}
	
	public void setTaxRates(List<TaxRate> taxRates) {
		if (taxRates == null) {
			throw new IllegalArgumentException("Tax rates cannot be null");
		}
		
		this.taxRates = new ArrayList<TaxRate>(taxRates);
	}
	
	public void addTaxRate(TaxRate taxRate) {
		if (taxRate == null) {
			throw new IllegalArgumentException("Tax rate cannot be null");
		}
		
		if (this.taxRates == null) {
			this.taxRates = new ArrayList<TaxRate>();
		}
		
		this.taxRates.add(taxRate);
	}

	@Override
	public LocaleEnum getLocaleEnum() {
		return localeEnum;
	}

	public void setLocaleEnum(LocaleEnum localeEnum) {
		this.localeEnum = localeEnum;
	}
}
